package com.ym521.simple

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.ym521.freesnack.theme.FreeSnackTheme
import com.ym521.freesnack.toToastBottomShort
import com.ym521.freesnack.toToastCenterShort
import com.ym521.freesnack.toToastTopShort
import com.ym521.simple.databinding.ActivityMainBinding
import com.yxqy.base_model.utils.FreeSnack

class MainActivity : AppCompatActivity() {
    /**
     * @param
     */
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val viewBind = ActivityMainBinding.inflate(layoutInflater)
        setContentView(viewBind.root)
        viewBind.root.postDelayed({
            toToastTopShort("我是顶部FreeSnack")
        }, 3 * 1000)

        viewBind.root.postDelayed({
            toToastCenterShort("我是中间FreeSnack",FreeSnackTheme.LIGHT)
        }, 5 * 1000)

        viewBind.root.postDelayed({
            toToastBottomShort("我是底部FreeSnack")
        }, 7 * 1000)
        viewBind.apply {
            tvTop.setOnClickListener {
                supportFragmentManager
                    .beginTransaction()
                    .replace(R.id.flFragment,SimpleFragment())
                    .commit()
            }
            tvCenter.setOnClickListener {
        }
            tvBottom.setOnClickListener {
        }
        }
    }
}